<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
	<head>
		<meta charset="utf-8">
		<title>公告管理</title>
		<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css" />
		<link rel="stylesheet" type="text/css" href="../../static/css/me.css" th:href="@{/css/me.css}"/>
	</head>
	<body>
		<!-- 头部 -->
		<nav class="ui padded-t-small">
			<div class="ui container">
				<div class="ui secondary menu">
					<h2 class="ui blue header item">辅导员管理系统</h2>
					<div class="right menu m-item m-mobile-hide">
						<div class="ui dropdown item">
							<div class="text">
								<i class="user blue big icon"></i>
								<span th:text="${session.user.nickname}">王锦超</span>
							</div>
							<i class="dropdown icon"></i>
							<div class="menu">
								<a href="#" th:href="@{/logout}" class="item">退出</a>
							</div>
						</div>
					</div>

				</div>
				<div class="ui secondary pointing three item demo menu">
					<a href="notice.html" th:href="@{/admin/notice}" class="active item">公告管理</a>
					<a href="record.html" th:href="@{/admin/record}" class="item">考勤管理</a>
					<a href="infor.html" th:href="@{/admin/infor}" class="item">学生信息</a>
				</div>
			</div>
		</nav>
		<!-- 主体 -->
		<div class="ui container margin-t-small">		
			<table class="ui celled table">
				<thead>
					<tr>
						<th class="four wide">发布时间</th>
						<th class="five wide">标题</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<tr th:each="news,iterStat : ${page.content}">
						<td th:text="${news.crateTime}">2020-02-02 20:20</td>
						<td th:text="${news.title}">刻意练习</td>
						<td>
							<a href="#" th:href="@{/admin/notice/{id}/input(id=${news.id})}" class="ui mini basic blue button">编辑</a>
							<a href="#" th:href="@{/new/{id}/delete(id=${news.id})}" onclick="return confirm('确定要删除吗？');" class="ui mini basic red button">删除</a>
						</td>
					</tr>
				</tbody>
				<tfoot>
					<tr>
						<th colspan="3">
							<div class="ui mini pagination menu" th:if="${page.totalPages}>1">
								<a th:href="@{/admin/notice(page=${page.number}-1)}" class="item" th:unless="${page.first}">上一页</a>
								<a th:href="@{/admin/notice(page=${page.number}+1)}" class="item" th:unless="${page.last}">下一页</a>
							</div>
							<a th:href="@{/admin/notice/input}" class="ui mini right floated basic blue button">新增</a>
						</th>
					</tr>
				</tfoot>
			</table>
			
		</div>



		<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
		<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
		<script>
			$('.ui.dropdown').dropdown();
		</script>
	</body>
</html>
